//package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class Con_Registration_LinkVerification extends SeleneseTestCase {
	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.gfwfn.com/);
		selenium.start();
	}

	@Test
	public void testUntitled() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("60000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Check out the all-new 2013 Fusion\"]"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isTextPresent("EVENT REGISTRATION"));
		verifyTrue(selenium.isElementPresent("css=strong"));
		verifyTrue(selenium.isTextPresent("exact:Please complete the form below to register for Go Further with Ford Night and be entered for a chance to win a trip including two tickets to see American Idol®!**"));
		verifyTrue(selenium.isElementPresent("css=p"));
		verifyTrue(selenium.isElementPresent("link=win a trip"));
		verifyTrue(selenium.isElementPresent("css=label.w80"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[3]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[4]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[5]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[2]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[2]/label[3]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[3]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[4]/label[3]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[4]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[5]/label[2]"));
		verifyTrue(selenium.isElementPresent("id=txtEmailLabel"));
		verifyTrue(selenium.isElementPresent("css=div.cbGroup > p.clearFix > label"));
		verifyTrue(selenium.isTextPresent("YES! Please email me communications including product information, offers, incentives and surveys from Ford Motor Company and the local dealer."));
		verifyTrue(selenium.isElementPresent("id=cbMarketingOptIn"));
		verifyTrue(selenium.isElementPresent("id=cbOver18"));
		verifyTrue(selenium.isElementPresent("css=div.cbGroup"));
		verifyTrue(selenium.isElementPresent("id=cbRules"));
		verifyTrue(selenium.isElementPresent("css=div.cbGroup"));
		verifyTrue(selenium.isElementPresent("css=p.bottomRight"));
		verifyTrue(selenium.isTextPresent("exact:*Required\n **See full official rules for details."));
		verifyTrue(selenium.isTextPresent("exact:*Required\n **See full official rules for details."));
		verifyTrue(selenium.isElementPresent("name=submit"));
		verifyTrue(selenium.isElementPresent("css=p.alignLeft.aiDisclaimer"));
		verifyTrue(selenium.isTextPresent("American Idol ®/© 19 TV Ltd. and FremantleMedia North America. 2013 All Rights Reserved. www.americanidol.com\nCharitable donations are the sole responsibility of Ford, not American Idol® or related parties."));
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isTextPresent("exact:First Name:*"));
		verifyTrue(selenium.isTextPresent("exact:Address:*"));
		verifyTrue(selenium.isTextPresent("exact:City*:"));
		verifyTrue(selenium.isTextPresent("Home Phone:"));
		verifyTrue(selenium.isTextPresent("M.I.:"));
		verifyTrue(selenium.isTextPresent("exact:Last Name:*"));
		verifyTrue(selenium.isTextPresent("exact:Apartment:"));
		verifyTrue(selenium.isTextPresent("exact:State*:"));
		verifyTrue(selenium.isTextPresent("exact:Zip Code*:"));
		verifyTrue(selenium.isTextPresent("Cell Phone:"));
		verifyTrue(selenium.isTextPresent("exact:Email:*"));
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
		selenium.click("css=img[alt=\"Check out the all-new 2013 Fusion\"]");
		
		}

	@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}
